﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jamaat_Financial_System.Model.BO;
using System.Collections.ObjectModel;
using System.Data.OleDb;
using Jamaat_Financial_System.Model.Util;

namespace Jamaat_Financial_System.Model.DAO
{
    class Halqa_DAO : Base_DAO
    {
        public ObservableCollection<Model.BO.Base_BO> _HalqaList = new ObservableCollection<Model.BO.Base_BO>();

        public override ObservableCollection<Model.BO.Base_BO> UpdateList()
        {
            command = new OleDbCommand("SELECT * FROM " + Constants.TableNames.HALQA + "", connection);
            OleDbDataReader reader = command.ExecuteReader();
            Halqa_BO halqaBO = null;
            while (reader.Read())
            {
                // Initializing new Tanzeem
                halqaBO = new Halqa_BO();

                //setters
                halqaBO.HalqaID = reader.GetString(Constants.HalqaTble.HALQAID);
                halqaBO.Halqa = reader.GetString(Constants.HalqaTble.HALQA);

                _HalqaList.Add(halqaBO);
            }

            return _HalqaList;
        }

        public override int Insert(Model.BO.Base_BO _record)
        {
            return -1;
        }

        public override int Delete(Model.BO.Base_BO _record)
        {
            return -1;
        }

    }
}
